package com.qf.controller;

import com.qf.pojo.SysUsers;
import com.qf.service.UserService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author fy
 * @version V1.0
 * @Project workspace
 * @Package com.qf.controller
 * @Description:
 * @Date 2022/6/20 1:01
 */
@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/list")
    @ResponseBody
    //限制只有某个角色的权限才能访问这个方法
//    @RequiresRoles(value = "管理员")
    @RequiresPermissions("sys:user:add")
    public List<SysUsers> findUserAll(){
        List<SysUsers> list = userService.findAll();
        return list;

    }
}
